import { defHttp } from '../http'
import type { CommonAPI } from '../model/_utils'
/**证书列表 */
export const getCertListApi: CommonAPI<'/api/cert/query', 'get'> = params =>
  defHttp.get('/api/cert/query', { params })
/**下载证书 */
export const downloadCertApi: CommonAPI<'/api/cert/download', 'post'> = data =>
  defHttp.post('/api/cert/download', { data })
/**获取证书 */
export const getCertApi: CommonAPI<'/api/cert', 'get'> = params =>
  defHttp.get('/api/cert', { params })
/**创建证书 */
export const createCertApi: CommonAPI<'/api/cert', 'post'> = data =>
  defHttp.post('/api/cert', { data })
/**批量创建证书 */
export const batchCreateCertApi: CommonAPI<'/api/cert/batch', 'post'> = data =>
  defHttp.post('/api/cert/batch', { data })
/**删除证书 */
export const deleteCertApi: CommonAPI<'/api/cert', 'delete'> = data =>
  defHttp.delete('/api/cert', { data })
/**更新证书 */
export const updateCertApi: CommonAPI<'/api/cert', 'put'> = data =>
  defHttp.put('/api/cert', { data })
/**更新自动续期 */
export const updateStatusApi: CommonAPI<'/api/cert/auto_renew', 'put'> = data =>
  defHttp.put('/api/cert/auto_renew', { data })
/**更新备注 */
export const updateDescApi: CommonAPI<'/api/cert/description', 'put'> = data =>
  defHttp.put('/api/cert/description', { data })
/**获取DNS记录 */
export const getDnsRecordApi: CommonAPI<
  '/api/cert/dns_resolve',
  'get'
> = params => defHttp.get('/api/cert/dns_resolve', { params })
/**查询证书日志 */
export const getCertLogApi: CommonAPI<'/api/cert/log', 'get'> = params =>
  defHttp.get('/api/cert/log', { params }, { isTransformResponse: false })
/**申请证书 */
export const applyCertApi: CommonAPI<'/api/cert/obtain', 'post'> = data =>
  defHttp.post('/api/cert/obtain', { data })
